1. Field of the Invention
The present invention relates to methods and systems for sending a rewrite control program to a control unit, such as a vehicle control unit. The control unit has a first function of receiving the sent rewrite control program to store it in a rewritable memory of the control unit, and a second function of causing the execution point of the control unit to jump to the leading address of the rewrite control program.
In addition, the present invention is associated with control units having the first and second functions set forth above, programs for sending a rewrite control program to a control unit, and boot programs capable of receiving a rewrite control program and booting it.
2. Description of the Related Art
In vehicle control, vehicle control units have used techniques for downloading a rewrite control program from the outside thereof and for executing the downloaded rewrite control program that allows the control units to rewrite application programs installed therein into new application programs. Such application programs include an engine-ignition control program, an automatic-transmission control program, and other similar vehicle-control programs.
An example of such rewrite control program downloading and executing methods, which has been used in common, includes the steps of
downloading a rewrite control program to a predetermined area of a RAM (Random Access Memory) of a vehicle control unit; and
causing the execution location to jump to the leading address of the predetermined area after the completion of the download in the RAM. A program that allows a vehicle control unit to carry out this method is referred to as a rewrite control program receiving and booting program hereinafter.
An actual example of the method in accordance with the rewrite control program receiving and booting program set forth above will be described hereinafter with reference to FIGS. 8 and 9. FIG. 8 is a view schematically illustrating the structure of a memory unit 50 of a vehicle control unit installed in a vehicle and illustrating data flow between an external tool 60, such as a personal computer, and the memory unit 50. FIG. 9 is a flowchart schematically illustrating the structure of a boot program 53 corresponding to the rewrite control program receiving and booting program.
In the actual example illustrated in FIGS. 8 and 9, the vehicle control unit runs the boot program 53 stored in a flash ROM (Read Only Memory) 51 of the memory unit 50 immediately after it is booted up. The boot program 53 causes the vehicle control unit to receive a rewrite control program 55 sent from the external tool 60 communicable with the vehicle control unit. The boot program 53 causes the vehicle control unit to store the received rewrite control program 55 in a predetermined area of a RAM 52 of the memory unit 50 from an address of the RAM 52 (see the arrow 61 in FIG. 8).
Specifically, as illustrated in FIG. 9, the boot program 53 allows the vehicle control unit to execute the following operations.
In step S531 of FIG. 9, the vehicle control unit executes initialization, and determines whether to detect a rewrite request sent from the external tool 60 in step S532.
When it is determined that no rewrite requests are detected after a predetermined period of time has elapsed, that is, when the determination in step S532 is NO, the execution point of the vehicle control unit jumps to an application program stored in the RAM 52 in step S532a. 
When it is determined that the rewrite request sent from the external tool 60 is detected, that is, the determination in step S532 is YES, the vehicle control unit waits for data being sent from the external tool 60 in step S533.
When the vehicle control unit receives an address command containing address data indicative of the address in the RAM 52 and data indicative of the size of the rewrite control program 55, which is sent from the external tool 60, the determination in step S534 is YES. Then, the vehicle control unit reads out the address data contained in the address command to store it in the RAM 52 as a rewrite address in step S535.
After that, every time the vehicle control unit receives a data command containing a module of the rewrite control program 55 in step S536, it reads out the module of the rewrite control program 55 contained in each data command to sequentially write the readout modules of the rewrite control program 55 into the RAM 52 from the rewrite address thereof in the order of reception in step S537.
When all of the modules constituting the rewrite control program 55 are stored in the RAM 52, the vehicle control unit causes its execution point to jump to the rewrite address of the RAM's predetermined area in which the rewrite control program is stored (see the arrow 62 in FIG. 8).
Specifically, as illustrated in step S538 of FIG. 9, the vehicle control unit determines whether the whole volume of the modules of the rewrite control program 55, which have ever been received to be stored in the RAM 52, reaches the volume equivalent to the size of the rewrite control program 55, which is received in step S534.
When it is determined that the whole volume of the modules of the rewrite control program 55, which have ever been received to be stored in the RAM 52, reaches the volume equivalent to the size of the rewrite control program 55, the vehicle control unit completes the download of the rewrite control program 55 in step S539. Subsequently, in step S539, the vehicle control unit causes its execution point to jump to the destination address corresponding to the rewrite address of the rewrite control program 55 stored in the RAM 52, exiting the boot program 53, and thereafter, starts to execute the rewrite control program 55.
The execution of the rewrite control program 55 allows the vehicle control unit to receive an application program 54 from the external tool 60, and to store the received application program 54 in a predetermined area of the flash ROM 51.
Application programs to be executed by various types of vehicle control units installed in vehicles of various models commonly have different program sizes depending on the vehicle destinations and/or the vehicle models. In addition, structures of memory units of the vehicle control units are commonly different from each other depending on the vehicle destinations and/or the vehicle models. These points may cause areas of RAMs in which rewrite control programs are stored to be different from each other.
From this viewpoint, the conventional rewrite control program receiving and booting program, which is referred to simply as conventional booting program, is described such that the execution point jumps to the predetermined address of the rewrite control program after the completion of the download. Accordingly, when installing the conventional booting programs into various types of vehicle control units, it may be necessary to rewrite the conventional booting programs so as to meet variable addresses to which the execution points of the various types of vehicle control units jump after the completion of the download, respectively.
The program rewrite operations may however cause the efficiency of installation of the conventional booting programs into the corresponding vehicle control units to deteriorate.